Fix error in scale factors for non-alpha case.
authorOwen Taylor <otaylor@redhat.com>
Sat, 19 Feb 2000 22:05:48 +0000 (22:05 +0000)
committerOwen Taylor <otaylor@src.gnome.org>
Sat, 19 Feb 2000 22:05:48 +0000 (22:05 +0000)
2000-02-19  Owen Taylor  <otaylor@redhat.com>

* gdk-pixbuf/pixops/pixops.c (scale_pixel): Fix error in
scale factors for non-alpha case.

gdk-pixbuf/ChangeLog
gdk-pixbuf/pixops/pixops.c

index a19b927dfa820c4269524eb1516820824ea2c1e9..d3b6f0805c5453a0b6891adddbd3011ed8b70e86 100644 (file)
@@ -1,3 +1,8 @@
+2000-02-19  Owen Taylor  <otaylor@redhat.com>
+
+       * gdk-pixbuf/pixops/pixops.c (scale_pixel): Fix error in
+       scale factors for non-alpha case.
+
 2000-02-14  Mark Crichton  <crichton@gimp.org>
 
        * gdk-pixbuf/io-xpm.c (xpm_extract_color): Added check for "g" color type.
index d6646cfcde4bbb484f8f6bb1c38f5d331841b5bf..80246505defbc16931b3919bd4e81927250b505e 100644 (file)
@@ -672,9 +672,9 @@ scale_pixel (art_u8 *dest, int dest_x, int dest_channels, int dest_has_alpha,
     }
   else
     {
-      dest[0] = r >> 16;
-      dest[1] = g >> 16;
-      dest[2] = b >> 16;
+      dest[0] = (r + 0xffffff) >> 24;
+      dest[1] = (g + 0xffffff) >> 24;
+      dest[2] = (b + 0xffffff) >> 24;
       
       if (dest_has_alpha)
        dest[3] = 0xff;
@@ -755,9 +755,9 @@ scale_line (int *weights, int n_x, int n_y,
                }
            }
 
-         dest[0] = r >> 16;
-         dest[1] = g >> 16;
-         dest[2] = b >> 16;
+         dest[0] = (r + 0xffff) >> 16;
+         dest[1] = (g + 0xffff) >> 16;
+         dest[2] = (b + 0xffff) >> 16;
          
          if (dest_has_alpha)
            dest[3] = 0xff;